package com.pig.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig.pojo.user.Admin;
import org.apache.ibatis.annotations.Select;


import java.util.List;

public interface AdminMapper extends BaseMapper<Admin> {
    /**分页查询展现管理员*/
    @Select("select * from p_admin limit #{startIndex},#{limit}")
    List<Admin> findAdminByPage(int startIndex, int limit);
    /**添加管理员
     * @return*/
    int saveAdmin(Admin admin);
    /**查看数据库是否有相同管理员*/
    @Select(("select * from p_admin where username=#{username}"))
    Admin FindByAdminName(String username);
    /**根据id改变管理员状态
     * @return*/
    void updateAdminStatusById(int id, int status);
}
